package cn.laixueit.rabbitmq;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.rabbit.annotation.RabbitListeners;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class listener {

    @RabbitListeners({
            @RabbitListener(queues = "leyou_sms")
    })
    public void listenerSms(Map<String,String> map){
        String phone =  map.get("phone");
        String code =  map.get("code");
        sms_send(phone,code);
    }

    private void sms_send(String phone,String code){
        System.out.println("发送短信....");
        System.out.println("手机号"+phone);
        System.out.println("验证码"+code);
        System.out.println("发送成功....");
    }
}
